﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>后台管理系统</title>
    <meta name="author" content="DeathGhost"/>
    <link rel="stylesheet" type="text/css" href="Css/style.css">
    <!--[if lt IE 9]>
    <script src="Scripts/html5.js"></script>
    <![endif]-->
    <script src="Scripts/jquery.js"></script>
    <script src="Scripts/jquery.mcustomscrollbar.concat.min.js"></script>
    <script>
        (function ($) {
            $(window).load(function () {

                $("a[rel='load-content']").click(function (e) {
                    e.preventDefault();
                    var url = $(this).attr("href");
                    $.get(url, function (data) {
                        $(".content .mCSB_container").append(data); //load new content inside .mCSB_container
                        //scroll-to appended content
                        $(".content").mCustomScrollbar("scrollTo", "h2:last");
                    });
                });

                $(".content").delegate("a[href='top']", "click", function (e) {
                    e.preventDefault();
                    $(".content").mCustomScrollbar("scrollTo", $(this).attr("href"));
                });

            });
        })(jQuery);
    </script>
</head>
<body>
<!--header-->
<header>
    <h1><img src="Picture/admin_logo.png"/></h1>
    <ul class="rt_nav">
        <li><a href="#" class="website_icon">站点首页</a></li>
        <li><a href="#" class="admin_icon">DeathGhost</a></li>
        <li><a href="#" class="clear_icon">清除缓存</a></li>
        <li><a href="#" class="set_icon">账号设置</a></li>
        <li><a href="login.jsp" class="quit_icon">安全退出</a></li>
    </ul>
</header>
<!--aside nav-->
<!--aside nav-->
<aside class="lt_aside_nav content mCustomScrollbar">
    <h2><a href="index.jsp">起始页</a></h2>
    <ul>
        <li>
            <dl>
                <dt>商品信息</dt>
                <!--当前链接则添加class:active-->
                <dd><a href="product_list.jsp">商品列表</a></dd>
                <dd><a href="recycle_bin.jsp">商品回收站</a></dd>
            </dl>
        </li>
        <li>
            <dl>
                <dt>订单信息</dt>
                <dd><a href="order_list.jsp">订单列表</a></dd>
                <dd><a href="order_detail.jsp" class="active">订单详情</a></dd>
            </dl>
        </li>
        <li>
            <dl>
                <dt>配送</dt>
                <dd><a href="express_list.jsp">配送方式</a></dd>
            </dl>
        </li>
        <li>
            <dl>
                <dt>在线统计</dt>
                <dd><a href="discharge_statistic.jsp" >流量统计</a></dd>
                <dd><a href="sales_volume.jsp">销售额统计</a></dd>
            </dl>
        </li>
        <li>
            <p class="btm_infor">© DeathGhost.cn 版权所有</p>
        </li>
    </ul>
</aside>

<section class="rt_wrap content mCustomScrollbar">
    <div class="rt_content">
        <div class="page_title">
            <h2 class="fl">订单详情示例</h2>
        </div>
        <table class="table">
            <tr>
                <td>收件人：${ordersVo.consigneeName}</td>
                <td>联系电话：${ordersVo.consigneephoone}</td>
                <td colspan="2">收件地址：${ordersVo.site}</td>
            </tr>
            <tr>
                <td>订单状态：<a>${ordersVo.stateName}</a></td>
                <td>付款时间：${ordersVo.paymentTime}</td>
                <td>下单时间：${ordersVo.creationTime}</td>

                <c:if test="${ordersVo.deliveryTime==null}">
                    <td>发货时间：---</td>
                </c:if>
                <c:if test="${ordersVo.deliveryTime!=null}">
                    <td id="delivery_time">发货时间：${ordersVo.deliveryTime}</td>
                </c:if>
            </tr>
            <tr>
                <td colspan="4">订单备注：
                    <mark>${ordersVo.remark}</mark>
                </td>
            </tr>
        </table>
        <table class="table">
            <c:forEach items="${orderInfoVo}" var="orderInfoVo">
            <tr>
                <td class="center"><img src="${orderInfoVo.filePath}" width="50" height="50"/></td>
                <td>${orderInfoVo.goodsName}</td>
                <td class="center">${orderInfoVo.orderNumder}</td>
                <td class="center"><strong class="rmb_icon">${orderInfoVo.price}</strong></td>
                <td class="center">
                    ${orderInfoVo.describe}
                </td>
                <td class="center"><strong>${orderInfoVo.quantity}</strong></td>
                <td class="center"><strong class="rmb_icon">${orderInfoVo.upmoneys}</strong></td>
                <td class="center">${orderInfoVo.units}</td>
            </tr>
            </c:forEach>
        </table>
        <aside class="mtb" style="text-align:right;">
            <label>管理员操作：</label>
            <input type="text" class="textbox textbox_295" placeholder="管理员操作备注"/>
            <input type="button" value="打印订单" class="group_btn"/>
            <input type="button" value="返回订单列表" id="godetail" class="group_btn"/>
            <input type="button" value="发货" class="group_btn" id="delivery"/>
            <input type="button" value="确认收货" class="group_btn"/>
        </aside>
    </div>
</section>
</body>
</html>
<script src="jquery.js"></script>
<script>
    $("#godetail").click(function () {
        location.href='OrdersServlet?pageNo=1&orderNumder=&state=0';
    });

    //点击发货事件
    $("#delivery").click(function () {
        $.get("UpdateServlet?opr=delivery&id=${ordersVo.orderID}",function (data) {
            if(data=="true"){
                location.href='OrderInfoServlet?id=${ordersVo.orderID}';
            }else {
                alert('发货失败');
            }
        });
    });
</script>